Return to doc.sitecore.com

Valid for Sitecore 5.2, 5.1.1
  Hello World
Prev Next

The Hello World Data Provider provides the proverbial simplest case example for implementing a data provider.  This provider does not actually integrate an external data source, but rather returns hard-coded text responses.  The idea is to show the minimum required to create a read-only data provider.

The data provider implements the following three methods: GetItemDefinition, GetItemFields, and GetTemplates.  This is enough to display a single item from the data provider in the Sitecore client.  The following steps describe what is required to implement the Hello World data provider.

Name the project HelloWorldExample.

Create a new C# class called HelloWorldProvider.

Add Using statements for the referenced Sitecore classes.

Change the code so that the class drives from the Sitecore DataProvider class.

Add the field definitions to be used in the methods for this class.

Add a method to generate an appropriate template for the returned item.

Create a method to return an item definition for the single item provided.

Create a method to return the fields associated with the item returned by the provider.

Create a method that gets a list of the available versions of an item.

Build the project to create the application library (.dll) in the Sitecore web root /bin folder.

Add a tag in the web.config file.

Add a tag in the web.config file.

The data provider can now be viewed from the Sitecore Desktop client.


Prev Next